#ifndef __USER_HPP__
#define __USER_HPP__
#include <string>

#include "eiennet.hpp"
#include "winux.hpp"

#include "../core.hpp"
#include "../message/message.hpp"

class MyServer;
// class Broad;
class Room;
class UserClientCtx;
class User
{
public:
    UserClientCtx *clientCtx = nullptr;
    mb isLogged = 0u;
    uint uid = 0;
    std::string name = "";
    uint headId = 0;
    MyServer *server = nullptr;
    Room *room = nullptr;

    static uint UidCounter;

    User(UserClientCtx *clientCtx);
    ~User();
    winux::Mixed getInfo();
    void init( MyServer *server );
    void emit(Message *msg);
    void onMessage(std::string const& data );
    void destroy();

    void enterRoom();
    void exitRoom();

    void getRandomHead();
};


#endif //__USER_HPP__
